package com.mr.security.web.webapp.rbac.entity;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Past;

import lombok.Data;

import com.fasterxml.jackson.annotation.JsonView;

/**
* User (作者): MRui
* TODO (描述)：userEntity
* Data：2019-01-14 23:58
*/
/*@Entity*/
@Data
public class User {

	public interface UserSimpleView {};
	public interface UserDetailView extends UserSimpleView {};

	private String id;

	//@MyConstraint(message = "这是一个测试")
	//@ApiModelProperty(value = "用户名")
	private String username;

	@NotBlank(message = "密码不能为空")
	private String password;

	@Past(message = "生日必须是过去的时间")
	private Date birthday;

	@JsonView(UserSimpleView.class)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@JsonView(UserDetailView.class)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@JsonView(UserSimpleView.class)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@JsonView(UserSimpleView.class)
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

}
